import request from "@/utils/back-request";
import crmRequest from "@/utils/crm-request";

export function captchaInit() {
  return request({
    url: "/api-auth/common/captcha/init",
    method: "get",
  });
}
export function getCaptcha(params) {
  return request({
    url: "api-auth/common/captcha/draw/" + params,
    method: "get",
  });
}
export function sendSms(data) {
  return request({
    url: "/api-career/zt/login/sms",
    method: "post",
    data,
  });
}
export function loginCustomerInfo(data) {
  return request({
    url: "/api-career/zt/login/customer/info",
    method: "get",
    data,
  });
}

// 2024年10月23日09:17:05 写的登录接口，在/login路由用的
// 职神籍校园C端登录，根据参数里的grant_type=password  或者  sms_code决定登录方式
export function loginAuthToken(data) {
  return request({
    url: "/api-auth/oauth/token",
    method: "post",
    data,
  });
}
// 职神籍校园C端注册
export function loginRegist(data) {
  return request({
    url: "/api-career/zt/login/regist",
    method: "post",
    data,
  });
}
// 业问的注册接口
export function loginRegistYW(data) {
  return request({
    url: "/api-yw/person/regist",
    method: "post",
    data,
  });
}
// 职神籍校园C端重置密码
export function loginResetPassword(data) {
  return request({
    url: "/api-career/zt/login/resetPassword",
    method: "post",
    data,
  });
}
// 手机号是否注册过？
export function loginIsRegist(data) {
  return request({
    url: "/api-career/zt/login/isRegist",
    method: "post",
    data,
  });
}
export function getFreeToken(data) {
  return request({
    url: "/api-career/zt/login/token",
    method: "get",
  });
}

export function sendRegisterSms(data) {
  return request({
    url: "/api-yw/person/regist/sms",
    method: "post",
    data,
  });
}export function sendLoginSms(data) {
  return request({
    url: "/api-yw/person/login/sms",
    method: "post",
    data,
  });
}
// 新写的接口End
// 下面是旧的

// 这里走的时候登录环境接口
export function getInfo(token) {
  return request({
    url: "/vue-admin-template/user/info",
    method: "get",
    params: { token },
  });
}

//运营中台登录
export function login(sid) {
  return crmRequest({
    url: "/admin/v1/public/index.php/userlogin/userlogin/sso/?sid=" + sid,
    method: "get",
  });
}

//运营中台登出
export function logout() {
  return crmRequest({
    url: "/admin/v1/public/index.php/userlogin/userlogin/logout",
    method: "get",
  });
}